<template>
	<view>
		<view class="bg"></view>
		<view class="help-top" v-for="(item,index) in list" :key="index">
			<view class="display-a padding-bottom_20rpx p-bo" @click="detail(item.id)">
				<image class="img-123" :src="item.icon"></image>
				<view style="width: 500rpx;">
					<view class="name">{{index+1}}.{{item.heading}}</view>
					<view class="color_999999 font-size_26rpx">{{item.subtitle}}</view>
				</view>
				<image class="img-124" src="../../static/124.png"></image>
			</view>
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
			}
		},
		
		onLoad() {
			
		},
		
		onShow() {
			if (uni.getStorageSync('staffId')) {
				uni.reLaunch({
					url: '/pages/index/writeOffPage'
				})
				return;
			}
			this.getList();
		},
		
		methods: {
			
			detail(id) {
				uni.navigateTo({
					url: '/pages/index/helpDetail?id='+id
				})
			},
			
			
			async getList() {
				const result = await this.$http.post({
					url: this.$api.helpList
				});
				if (result.code == 2000) {
					this.list = result.data;
				} else {
					this.$sun.toast(result.msg, 'none');
				}
			},
			
		}
	}
</script>

<style lang="scss">
	
	.img-124 {
		width: 40rpx;
		height: 40rpx;
		margin-left: auto;
	}
	
	.name {
		color: #333333;
		margin-bottom: 8rpx;
	}
	
	.img-123 {
		width: 60rpx;
		height: 60rpx;
		margin-right: 20rpx;
	}
	
	.help-top {
		width: 750rpx;
		border-radius: 20rpx;
		margin-top: -20rpx;
		padding: 40rpx 50rpx;
		background-color: #FFF;
	}
	
	.bg {
		width: 750rpx;
		height: 350rpx;
		background: url('~static/122.png');
		background-repeat: no-repeat;
		background-size: contain;
	}
	
</style>
